{template header_admin}
<div id="pagecontainer">
	<div class="toolbar">
    	<div class="f-right">
        	<a href="/?m=$G[m]&c=$G[c]&a=publish" class="baritem">添加页面</a>
        </div>
    	<strong>页面分类</strong>
    </div>
    <div class="table-hd">
	<form method="post" action="">
        <input type="hidden" name="formsubmit" value="yes" />
        <input type="hidden" name="formhash" value="{FORMHASH}">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="listtable">
        <thead>
        <tr>
          <th width="30" class="center">删?</th>
          <th width="80">显示顺序</th>
          <th width="300">标题</th>
          <th></th>
        </tr>
        </thead>
        <tbody id="newPage">
        {loop $categorylist $clist}
        <tr>
          <td>
          <input type="checkbox" class="checkbox" name="delete[]" value="$clist[pageid]" />
          <input type="hidden" name="newclass[pageid][]" value="$clist[pageid]">
          </td>
          <td><input type="text" class="text w60" name="newclass[displayorder][]" value="$clist[displayorder]" maxlength="4"></td>
          <td colspan="3">
            <input type="text" class="text w200" name="newclass[title][]" value="$clist[title]" maxlength="10"> 
          </td>
        </tr>
        {/loop}
        </tbody>
        <tfoot>
        <tr>
            <td colspan="5">
            <label><input type="checkbox" class="checkbox" node="checkall" name="delete[]" value="0" /> 全选</label>
            <a href="javascript:;" onclick="addClass()"><i class="icon">&#xf0154;</i>添加分类</a></td>
        </tr>
        <tr>
            <td colspan="5">
                <input type="submit" class="submit" value="提交" />
                <input type="button" class="button" value="刷新" onclick="window.location.reload()" />
            </td>
        </tr>
        </tfoot>
      </table>
 </form>
 </div>
</div>
<script type="text/template" id="tplClass">
<tr class="white">
  <td><input type="hidden" name="newclass[pageid][]" value="0"></td>
  <td><input type="text" class="text w60" name="newclass[displayorder][]" value="0" maxlength="4"></td>
  <td colspan="3"><input type="text" class="text w200" name="newclass[title][]" value="" maxlength="10"></td>
</tr>
</script>
<script type="text/javascript">
function addClass(){
	$("#newPage").append($("#tplClass").html());
}
$("input[node=checkall]").click(function(){
	$("input[name='delete[]']").attr('checked',$(this).is(":checked"));
});
</script>
{template footer_admin}